<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="Handheldfriendly" content="true">
    <!-- 微软的老式浏览器 -->
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <!-- 显示窗口 宽度 是 客户端的 屏幕 宽度 （就是 满屏 ！），显示的文字和图形的初始比例 是 1.0 -->
    <link rel="stylesheet" href="css/weui.min.css">
    <link rel="stylesheet" href="css/layui.mobile.css">
    <link rel="stylesheet" type="text/css" href="css/style.css"><!-- 基本样式 -->
    <link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
    <link rel="prefetch" href="http://cpbridge.bceapp.com/index.html" />
    <link rel="prefetch" href="http://cpbridge.bceapp.com/Single-circle.html" />
    <link rel="prefetch" href="http://cpbridge.bceapp.com/message.html" />
    <link rel="prefetch" href="http://cpbridge.bceapp.com/activity.html" />
    <link rel="prefetch" href="http://cpbridge.bceapp.com/mine.html" />
    <script src="js/jquery/rem.min.js"></script>
    <script src="js/common.js"></script>
    <!--<script src="http://192.168.199.170:8080/target/target-script-min.js#anonymous"></script>-->
<style>
    .swiper-container img{
        width: 100%;
    }
    .black_overlay{
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    z-index:1001;
    -moz-opacity: 0.8;
    opacity:.80;
    filter: alpha(opacity=80);
    }

  .spinner{width:20px;height:20px;position:fixed;z-index:1002;top:50%;margin-top:-10px;left:50%;margin-left:-10px}.container1>div,.container2>div,.container3>div{width:6px;height:6px;background-color:#ff536a;border-radius:100%;position:absolute;-webkit-animation:bouncedelay 1.2s infinite ease-in-out;animation:bouncedelay 1.2s infinite ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both}.spinner .spinner-container{position:absolute;width:100%;height:100%}.container2{-webkit-transform:rotateZ(45deg);transform:rotateZ(45deg)}.container3{-webkit-transform:rotateZ(90deg);transform:rotateZ(90deg)}.circle1{top:0;left:0}.circle2{top:0;right:0}.circle3{right:0;bottom:0}.circle4{left:0;bottom:0}.container2 .circle1{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.container3 .circle1{-webkit-animation-delay:-1.0s;animation-delay:-1.0s}.container1 .circle2{-webkit-animation-delay:-0.9s;animation-delay:-0.9s}.container2 .circle2{-webkit-animation-delay:-0.8s;animation-delay:-0.8s}.container3 .circle2{-webkit-animation-delay:-0.7s;animation-delay:-0.7s}.container1 .circle3{-webkit-animation-delay:-0.6s;animation-delay:-0.6s}.container2 .circle3{-webkit-animation-delay:-0.5s;animation-delay:-0.5s}.container3 .circle3{-webkit-animation-delay:-0.4s;animation-delay:-0.4s}.container1 .circle4{-webkit-animation-delay:-0.3s;animation-delay:-0.3s}.container2 .circle4{-webkit-animation-delay:-0.2s;animation-delay:-0.2s}.container3 .circle4{-webkit-animation-delay:-0.1s;animation-delay:-0.1s}@-webkit-keyframes bouncedelay{0%,80%,100%{-webkit-transform:scale(0.0)}40%{-webkit-transform:scale(1.0)}}@keyframes bouncedelay{0%,80%,100%{transform:scale(0.0);-webkit-transform:scale(0.0)}40%{transform:scale(1.0);-webkit-transform:scale(1.0)}}#loading .mask{position:fixed;width:100%;background-color:#fff;top:0;left:0;height:100%;z-index:1001}

    #loading .mask{
        position: fixed;
        width: 100%;
        background-color: #fff;
        /* opacity: .6; */
        top: 0;
        left: 0;
        height: 100%;
        z-index: 1001;
    }
    #wrap{-webkit-overflow-scrolling: touch;}
</style>
   <link rel="stylesheet" href="css/swiper.min.css">
    <title>CP</title>
</head>
<body>
<div id="loading">
    <div class="mask"></div>
    <div class="spinner">
        <div class="spinner-container container1">
            <div class="circle1"></div>
            <div class="circle2"></div>
            <div class="circle3"></div>
            <div class="circle4"></div>
        </div>
        <div class="spinner-container container2">
            <div class="circle1"></div>
            <div class="circle2"></div>
            <div class="circle3"></div>
            <div class="circle4"></div>
        </div>
        <div class="spinner-container container3">
            <div class="circle1"></div>
            <div class="circle2"></div>
            <div class="circle3"></div>
            <div class="circle4"></div>
        </div>
    </div>
</div>
    <div onscroll="gcscroll(this)" id="wrap">

            <div class="swiper-container swiper-container-horizontal">
                <div  class="swiper-wrapper" id="banner">
                </div>
                <!-- Add Pagination -->
                <div class="swiper-pagination swiper-pagination-clickable swiper-pagination-bullets" style="position: absolute;bottom: 10px"></div>
                <!-- Add Arrows -->
            </div>
            <!-- 公告开始 -->
            <div class="announcement">
                 <ul id="zxlist">
                    <!--<li class="layui-icon" style="font-size:24px;color:#ff7a8f;">&#xe645;<span style="font-size:16px;font-weight:200"><a href="">最新加入:迪丽热巴加入CP</a></span></li>-->
                </ul>
            </div>
            <!-- 公告结束 -->
            <!-- 单身筛选开始 -->
            <div class="screening">
               <input type="button" id="Button1" value="单身精选" onclick="ShowDiv('MyDiv','fade')"><i class="sxbtn icon-tasks" onclick="ShowDiv('MyDiv','fade')"></i>
                 <a href="details.html">更多</a>
                <div id="fade" class="black_overlay"></div>
                <div id="MyDiv" class="white_content">
                    <div style="text-align: right; height:32px;">
                        <p class="layui-icon" style="font-size: 24px; color: #1E9FFF;overflow: hidden;" onclick="CloseDiv('MyDiv','fade')">&#x1007</p>
                    </div>
                    <span data-id="0" onclick="xz(this)"><img src="images/img/qb.png"></span>
                    <span data-id="1" onclick="xz(this)"><img src="images/img/nan.png" alt="" ></span>
                    <span data-id="2" onclick="xz(this)"><img src="images/img/nv.png" alt="" ></span>
                </div>
            </div> 
            <!-- 单身筛选结束 -->
            <div class="figures-list" style="padding-bottom: 55px;">
                <ul id="list">
                </ul>
            </div>
    </div>
<!-- 底部菜单栏 -->
    <footer>
        <ul class="tab-nav">
           <li>
               <a href="">
                    <div class="icon-box">
                        <i class="icon"></i>
                    </div>
                    <div>
                        <span class="active">首页</span>
                    </div>
               </a>
           </li>
             <li>
               <a href="Single-circle.html">
                    <div class="icon-box">
                        <i class="icondsp"></i>
                    </div>
                    <div>
                        <span>单身圈</span>
                    </div>
               </a>
           </li>
                  <li>
               <a href="message.html">
                    <div class="icon-box">
                        <i class="icon-xx"></i>
                    </div>
                    <div>
                        <span>消息</span>
                    </div>
               </a>
           </li>
            <li>
               <a href="activity.html">
                    <div class="icon-box">
                        <i class="iconhd"></i>
                    </div>
                    <div>
                        <span>活动</span>
                    </div>
               </a>
           </li>
            <li>
               <a href="mine.html">
                    <div class="icon-box">
                        <i class="iconmy"></i>
                    </div>
                    <div>
                        <span>我的</span>
                    </div>
               </a>
           </li>
        </ul>
    </footer>
<div id="loadingToast" style="display: none">
    <div class="weui-mask_transparent"></div>
    <div class="weui-toast">
        <i class="weui-loading weui-icon_toast"></i>
        <p class="weui-toast__content">数据加载中</p>
    </div>
</div>
    <script src="js/jquery/jquery-2.2.4.min.js"></script>
    <script src="js/jquery/swiper.min.js"></script>
    <script src="js/index.js"></script>
    <!--<script src="js/jquery/console.js"></script>-->
    <script src="js/utils.js"></script>
    <script>
        Utils.historyBack(function () {
            WeixinJSBridge.invoke("closeWindow",{},function(e){});
        });
        var url="http://cpbridge.bceapp.com";
        localStorage.cpurl = url;
        if(typeof(localStorage.oid) == "undefined" || localStorage.oid == "") {
            /**
             * 此时还不能判断是用户第一次访问，未进行授权，还是已经授权完成，但还未进行信息本地存储
             */
            $.ajax({
                type : "GET",
                url : getRequestUrl("/user/get_self_detail"),
                success : function(data) {
                	/**
                	* 说明已经授权完成，但是需要将相关信息进行本地存储
                	*/
                    var userinfo = data.response_params.result;
                    localStorage.txurl = userinfo.portrait;
                    localStorage.oid = "?wx_openid="+userinfo.wx_openid;
                    localStorage.id = userinfo.user_id;
                },
                error : function(err) {
                    if (typeof(err.responseJSON.error_code) != "undefined" && err.responseJSON.error_code != 0) {
                        /**
                         * 此时说明此次请求发生了错误，不同的error_code代表不同的错误类型
                         */
                        if (err.responseJSON.error_code == 30603) {
                            /**
                             * 说明该用户是第一次访问，还没有进行授权，需要让其进行授权操作，直接跳转到登录请求，不用传递任何参数
                             */
                            window.location.href = localStorage.cpurl + "/user/login";
                        } else if (typeof(err.responseJSON.error_msg) != "undefined") {
                            /**
                             * 说明发生了其它未知服务端错误
                             */
                            alert(err.responseJSON.error_msg);
                        } else {
                            alert("网络异常，请您稍后重试");
                        }
                    } else {
                    	alert("网络异常，请您稍后重试");
                    }
                }
            });
        } else {
            /**
             * 走到这说明用户肯定曾经授权访问过了，但是写入用户浏览器中的cookie信息不一定存在了，在初始登录时需要校验一次
             */
            $.ajax({
                type : "GET",
                url : getRequestUrl("/user/get_self_detail"),
                success : function(data) {
                    /**
                    * 走到此处说明一切正常，不仅已经授权过，而且cookie信息也在，无需多做其它操作
                    */
                },
                error : function(err) {
                    if (typeof(err.responseJSON.error_code) != "undefined" && err.responseJSON.error_code != 0) {
                        /**
                         * 此时说明此次请求发生了错误，不同的error_code代表不同的错误类型
                         */
                        if (err.responseJSON.error_code == 30603) {
                            /**
                             * 说明该用户并非第一次访问，曾经进行过授权，但是其浏览器cookie信息丢失了，需要重新种植一次
                             */
                             $.ajax({
                                 type : "GET",
                                 url : localStorage.cpurl+"/user/login" + localStorage.oid,
                                 success : function(data) {
                                	 /**
                                	 * 走到此处说明种cookie成功
                                	 */
                                 },
                                 error : function(err) {
                                     if (typeof(err.responseJSON.error_code) != "undefined" && err.responseJSON.error_code != 0) {
                                         if (typeof(err.responseJSON.error_msg) != "undefined") {
                                             alert(err.responseJSON.error_msg);
                                         } else {
                                             alert("网络异常，请您稍后重试");
                                         }
                                     } else {
                                         alert("网络异常，请您稍后重试");
                                     }
                                 }
                             });
                        } else if (typeof(err.responseJSON.error_msg) != "undefined") {
                            alert(err.responseJSON.error_msg);
                        } else {
                            alert("网络异常，请您稍后重试");
                        }
                    } else {
                    	alert("网络异常，请您稍后重试");
                    }
                }
            });
        }
        var Whei=$(window).height();
        var Wwei=$(window).width();
        if(Wwei>750){
            Wwei=750;
        }
        $("#wrap").css({"height":Whei,"width":Wwei});
        getbanner();
        getNew();
        getuser();
        $(function () {
        //获得当前<ul>

       });
    </script>
</body>
</html>